package com.wcar.store.controller;

import com.wcar.common.entity.Car;
import com.wcar.common.entity.CarStore;
import com.wcar.common.entity.CarWashRecord;
import com.wcar.common.vo.Result;
import com.wcar.store.service.CarService;
import com.wcar.store.service.WashRecordService;
import com.wcar.store.vo.BindPlusVo;
import com.wcar.store.vo.CarWashRecordVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.List;

/**
 * @BelongsProject: four-wcar-idea
 * @BelongsPackage: com.wcar.store.controller
 * @Author: 李睢康
 * @CreateTime: 2024-06-04  10:32
 */
@RestController
@RequestMapping("/store/washrecord")
public class WashRecordController {

    @Resource
    private WashRecordService service;
    @Resource
    private CarService carService;
    @GetMapping("/api/selectRecord")
    public Result<List<CarWashRecordVo>> findRecord(Integer storeId){
        return service.findByStoreId(storeId);
    }
    @PostMapping("/api/insertCarWahRecord")
    public Result<Integer> insertWa(@RequestBody BindPlusVo bindPlusVo){
        return service.insertWa(bindPlusVo);
    }
    @PostMapping("/api/selectByUserId")
    public Result<List<CarWashRecord>> findCarStore(@RequestBody BindPlusVo bindPlusVo){
        return carService.selectCar(bindPlusVo);
    }

}
